// Decompiled on 周六 2月 22 19:31:49 CST 2025 with Zomboid Decompiler v0.1.3 using Vineflower.
package zombie.iso.sprite.shapers;

import java.util.function.Consumer;
import zombie.core.textures.TextureDraw;
import zombie.debug.DebugOptions;

public class DiamondShaper implements Consumer<TextureDraw> {
    public static final DiamondShaper instance = new DiamondShaper();

    public void accept(TextureDraw ddraw) {
        if (DebugOptions.instance.Terrain.RenderTiles.IsoGridSquare.MeshCutdown.getValue()) {
            float float0 = ddraw.x0;
            float float1 = ddraw.y0;
            float float2 = ddraw.x1;
            float float3 = ddraw.y1;
            float float4 = ddraw.y2;
            float float5 = ddraw.y3;
            float float6 = float2 - float0;
            float float7 = float4 - float3;
            float float8 = float0 + float6 * 0.5F;
            float float9 = float3 + float7 * 0.5F;
            float float10 = ddraw.u0;
            float float11 = ddraw.v0;
            float float12 = ddraw.u1;
            float float13 = ddraw.v1;
            float float14 = ddraw.v2;
            float float15 = ddraw.v3;
            float float16 = float12 - float10;
            float float17 = float14 - float11;
            float float18 = float10 + float16 * 0.5F;
            float float19 = float13 + float17 * 0.5F;
            ddraw.x0 = float8;
            ddraw.y0 = float1;
            ddraw.u0 = float18;
            ddraw.v0 = float11;
            ddraw.x1 = float2;
            ddraw.y1 = float9;
            ddraw.u1 = float12;
            ddraw.v1 = float19;
            ddraw.x2 = float8;
            ddraw.y2 = float5;
            ddraw.u2 = float18;
            ddraw.v2 = float15;
            ddraw.x3 = float0;
            ddraw.y3 = float9;
            ddraw.u3 = float10;
            ddraw.v3 = float19;
        }
    }
}
